/*    */ package com.zimbra.cs.service.admin;
/*    */ 
/*    */ import com.zimbra.common.account.Key.DistributionListBy;
/*    */ import com.zimbra.common.service.ServiceException;
/*    */ import com.zimbra.common.soap.Element;
/*    */ import com.zimbra.common.util.Log;
/*    */ import com.zimbra.common.util.ZimbraLog;
/*    */ import com.zimbra.cs.account.Group;
/*    */ import com.zimbra.cs.account.Provisioning;
/*    */ import com.zimbra.cs.account.accesscontrol.AdminRight;
/*    */ import com.zimbra.cs.account.accesscontrol.Rights.Admin;
/*    */ import com.zimbra.soap.JaxbUtil;
/*    */ import com.zimbra.soap.ZimbraSoapContext;
/*    */ import com.zimbra.soap.admin.message.DeleteDistributionListRequest;
/*    */ import com.zimbra.soap.admin.message.DeleteDistributionListResponse;
/*    */ import java.util.List;
/*    */ import java.util.Map;
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ public class DeleteDistributionList
/*    */   extends DistributionListDocumentHandler
/*    */ {
/*    */   public boolean domainAuthSufficient(Map context)
/*    */   {
/* 45 */     return true;
/*    */   }
/*    */   
/*    */ 
/*    */ 
/*    */ 
/*    */   public boolean defendsAgainstDelegateAdminAccountHarvesting()
/*    */   {
/* 53 */     return true;
/*    */   }
/*    */   
/*    */   protected Group getGroup(Element request) throws ServiceException
/*    */   {
/* 58 */     String id = request.getAttribute("id");
/* 59 */     return Provisioning.getInstance().getGroup(Key.DistributionListBy.id, id);
/*    */   }
/*    */   
/*    */   public Element handle(Element request, Map<String, Object> context)
/*    */     throws ServiceException
/*    */   {
/* 65 */     ZimbraSoapContext zsc = getZimbraSoapContext(context);
/* 66 */     Provisioning prov = Provisioning.getInstance();
/* 67 */     DeleteDistributionListRequest req = (DeleteDistributionListRequest)JaxbUtil.elementToJaxb(request);
/*    */     
/* 69 */     Group group = getGroupFromContext(context);
/* 70 */     String id = req.getId();
/* 71 */     defendAgainstGroupHarvesting(group, Key.DistributionListBy.id, id, zsc, Rights.Admin.R_deleteGroup, Rights.Admin.R_deleteDistributionList);
/*    */     
/*    */ 
/* 74 */     prov.deleteGroup(group.getId());
/*    */     
/* 76 */     ZimbraLog.security.info(ZimbraLog.encodeAttrs(new String[] { "cmd", "DeleteDistributionList", "name", group.getName(), "id", group.getId() }));
/*    */     
/*    */ 
/* 79 */     return zsc.jaxbToElement(new DeleteDistributionListResponse());
/*    */   }
/*    */   
/*    */   public void docRights(List<AdminRight> relatedRights, List<String> notes)
/*    */   {
/* 84 */     relatedRights.add(Rights.Admin.R_deleteDistributionList);
/* 85 */     relatedRights.add(Rights.Admin.R_deleteGroup);
/*    */   }
/*    */ }


/* Location:              /home/mint/zimbrastore.jar!/com/zimbra/cs/service/admin/DeleteDistributionList.class
 * Java compiler version: 7 (51.0)
 * JD-Core Version:       0.7.1
 */